﻿using PCCardN.Pages;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace PCCardN
{
    public partial class Form1 : Form
    {

        public Form1()
        {
            InitializeComponent();
            ShowNavInfo();
        }

        private void buttonItem1_Click(object sender, EventArgs e)
        {
            ShowNavInfo();
        }

        public void ShowNavInfo()
        {
            Frm_Index navinfo = new Frm_Index();
           
            tabControl1.TabPages.Add(navinfo);
        }

        private void buttonItem2_Click(object sender, EventArgs e)
        {
            Frm_Search navinfo = new Frm_Search();
            tabControl1.TabPages.Add(navinfo);
        }

        private void Form1_FormClosed(object sender, FormClosedEventArgs e)
        {
            System.Environment.Exit(0);
        }
        Frm_Acceptance frm1 = null;
        private void buttonItem5_Click(object sender, EventArgs e)
        {
            if (frm1 == null || frm1.IsDisposed)
            {

                frm1 = new Frm_Acceptance();
                tabControl1.TabPages.Add(frm1);
            }
            else
            {
                SelectTabControl(frm1.Name);
            }
           
        }

        //private void Form1_Load(object sender, EventArgs e)
        //{
        //    this.Hide();
        //    FrmLogin frm = new FrmLogin();
        //    frm.ShowDialog();
        //    if (!frm.LoginSuccess)
        //    {
        //        frm.Close();
        //        this.Close();
        //    }
        //    this.Show();
        //}
    }
}
